
<%@ page import="edu.hawaii.kukui.Activity" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'activity.label', default: 'Activity')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${activityInstance}">
            <div class="errors">
                <g:renderErrors bean="${activityInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="title"><g:message code="activity.title.label" default="Title" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'title', 'errors')}">
                                    <g:textArea name="title" cols="40" rows="5" value="${activityInstance?.title}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description"><g:message code="activity.description.label" default="Description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'description', 'errors')}">
                                    <g:textArea name="description" cols="40" rows="5" value="${activityInstance?.description}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="activityType"><g:message code="activity.activityType.label" default="Activity Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'activityType', 'errors')}">
                                    <g:select name="activityType" from="${activityInstance.constraints.activityType.inList}" value="${activityInstance?.activityType}" valueMessagePrefix="activity.activityType"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="verificationType"><g:message code="activity.verificationType.label" default="Verification Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'verificationType', 'errors')}">
                                    <g:select name="verificationType" from="${activityInstance.constraints.verificationType.inList}" value="${activityInstance?.verificationType}" valueMessagePrefix="activity.verificationType"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="eventDate"><g:message code="activity.eventDate.label" default="Event Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'eventDate', 'errors')}">
                                    <g:datePicker name="eventDate" precision="day" value="${activityInstance?.eventDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="expirationDate"><g:message code="activity.expirationDate.label" default="Expiration Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'expirationDate', 'errors')}">
                                    <g:datePicker name="expirationDate" precision="day" value="${activityInstance?.expirationDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="activityAlias"><g:message code="activity.activityAlias.label" default="Activity Alias" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'activityAlias', 'errors')}">
                                    <g:textField name="activityAlias" value="${activityInstance?.activityAlias}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="expectedDuration"><g:message code="activity.expectedDuration.label" default="Expected Duration" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'expectedDuration', 'errors')}">
                                    <g:textField name="expectedDuration" value="${fieldValue(bean: activityInstance, field: 'expectedDuration')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="kukuiNuts"><g:message code="activity.kukuiNuts.label" default="Kukui Nuts" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'kukuiNuts', 'errors')}">
                                    <g:textField name="kukuiNuts" value="${fieldValue(bean: activityInstance, field: 'kukuiNuts')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lastUpdated"><g:message code="activity.lastUpdated.label" default="Last Updated" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'lastUpdated', 'errors')}">
                                    <g:datePicker name="lastUpdated" precision="day" value="${activityInstance?.lastUpdated}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dateCreated"><g:message code="activity.dateCreated.label" default="Date Created" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'dateCreated', 'errors')}">
                                    <g:datePicker name="dateCreated" precision="day" value="${activityInstance?.dateCreated}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="publicationDate"><g:message code="activity.publicationDate.label" default="Publication Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: activityInstance, field: 'publicationDate', 'errors')}">
                                    <g:datePicker name="publicationDate" precision="day" value="${activityInstance?.publicationDate}"  />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
